package com.arcbbs.utils;

import com.arcbbs.entity.SysSettingDto;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.spi.CurrencyNameProvider;

public class SysCacheUtils {
    private static final String KEY_SYS="sys_setting";
    //ConcurrentHashMap本质上是一个Segment数组，而一个Segment实例又包含若干个桶，每个桶中都包含一条由若干个 HashEntry 对象链接起来的链表
    private static final Map<String, SysSettingDto> CACHE_DATA=new ConcurrentHashMap<>();
    //获取对象数组
    public static SysSettingDto getSysSetting(){
        return CACHE_DATA.get(KEY_SYS);
    }
    //加入对象数组
    public static void refres(SysSettingDto dto){
        CACHE_DATA.put(KEY_SYS,dto);
    }

}
